package cn.fl.insroute.service;

import java.util.List;

import cmm.comm.facade.framework.dto.SysDictionaryDTO;
import cmm.mid.core.framework.dto.DataResultDTO;
import cn.fl.insroute.condition.InsRouteBscInfoQC;
import cn.fl.insroute.vo.InsRouteBscInfoVO;
import cmm.mid.core.framework.page.Pager;
import cn.cmm.base.framework.exception.BaseException;
import cn.fl.project.vo.PrjBscInfoVO;
import cn.fl.project.vo.PrjPrdBscInfoVO;
import cn.fl.project.vo.PrjQuatPrpsVO;

/**
 * @Description: 资管路由基础信息表 客户端服务层接口
 * @Description: 持久层方法名称前缀：新增：insert* 删除：delete* 修改：update* 批量：batch* 查询对象：select* get* find* 查询集合：select*
 * @Description: 业务层方法名称前缀：新增：add* 删除：remove* 修改：modify* 查询对象：select* get* 批量：batch* 查询集合：search*
 */
public interface IInsRouteBscInfoService {

	/**
	 * 获取唯一对象
	 * @param id 主键
	 * @return 对象DTO
	 */
	public InsRouteBscInfoVO selectById(Long id)throws BaseException;

	/**
	 * 新增
	 * @param entity
	 * @return
	 */
	public Long add(InsRouteBscInfoVO entity) throws BaseException;

	/**
	 * 删除
	 * @param id
	 * @return
	 */
	public boolean removeById(Long id)throws BaseException;

	/**
	 * 删除
	 * @param ids
	 * @return
	 */
	public boolean removeByIds(List<Long> ids)throws BaseException;

	/**
	 * 修改
	 * @param entity
	 * @return
	 */
	public boolean modify(InsRouteBscInfoVO entity)throws BaseException;

	/**
	 * 分页查询所有
	 * @param page
	 * @return
	 */
	public Pager searchListPage(Pager page)throws BaseException;

	/**
	 * 条件查询资管路由基础信息
	 * @param insRouteBscInfoQC
	 * @return
	 */
	public List<InsRouteBscInfoVO> searchList(InsRouteBscInfoQC insRouteBscInfoQC)throws BaseException;

	/**
	 * 根据项目ID查询资管路由基础信息
	 * @param prjId
	 * @return
	 */
	public InsRouteBscInfoVO searchListByPrjId(Long prjId)throws BaseException;

	/**
	 * 保存路由信息，机构信息等
	 * @param prjBscInfoVO
	 * @param insRouteBscInfoVO
	 * @return
	 * @throws BaseException
	 */
	public Long modifyInsRouteBscInfo(PrjBscInfoVO prjBscInfoVO,InsRouteBscInfoVO insRouteBscInfoVO)throws BaseException;

	/**
	 * 校验路由信息变化
	 * @param checkedInsId
	 * @param insRouteBscInfoVO
	 * @return
	 * @throws BaseException
	 */
	public DataResultDTO checkChange(Long checkedInsId, InsRouteBscInfoVO insRouteBscInfoVO)throws BaseException;

	/**
	 * 获取费用项名称
	 * @param code
	 * @return
	 * @throws BaseException
	 */
	public SysDictionaryDTO getFeeTypCdNm(String code)throws BaseException;

	/**
	 * 获取费用计算基数名称
	 * @param code
	 * @return
	 * @throws BaseException
	 */
	public SysDictionaryDTO getCalBaseCdNm(String code)throws BaseException;

	/**
	 * 获取费用计入方式名称
	 * @param code
	 * @return
	 * @throws BaseException
	 */
	public SysDictionaryDTO getCntWayCdNm(String code)throws BaseException;

	/**
	 * 筛选结果（路由）
	 * @param insRouteBscInfoVO
	 * @return
	 * @throws BaseException
	 */
	public DataResultDTO routeRes(InsRouteBscInfoVO insRouteBscInfoVO)throws BaseException;

	/**
	 * 筛选结果(方案)
	 * @param prjQuatPrps
	 * @param flag 0 测算 1 方案
	 * @return
	 * @throws BaseException
	 */
	public DataResultDTO routeResPrps(PrjQuatPrpsVO prjQuatPrps,Integer flag)throws BaseException;

	/**
	 * 同步路由信息，产品信息
	 * @param prjId 项目ID
	 * @param mediationFeeAmt 增量调节费
	 * @param usrId
	 * @return
	 * @throws BaseException
	 */
	public Boolean synchroInfo(Long prjId,Long mediationFeeAmt,Long usrId)throws BaseException;

	/**
	 * 同步路由信息
	 * @param prjPrdBscInfoVOList
	 * @param flag 0 新增  1修改  2 删除
	 * @return
	 * @throws BaseException
	 */
	public Boolean synchroInsInfo(List<PrjPrdBscInfoVO> prjPrdBscInfoVOList, Integer flag)throws BaseException;

	/**
	 * 同步路由信息(二手车)
	 * @param prjPrdBscInfoVOList
	 * @param flag 0 新增  1修改  2 删除
	 * @return
	 * @throws BaseException
	 */
	public Boolean synchroInsInfoEsc(List<PrjPrdBscInfoVO> prjPrdBscInfoVOList, Integer flag)throws BaseException;


    /**
     * 资管路由验证
     * @return
     */
    public List<SysDictionaryDTO> searchRouteCheck() throws BaseException;

	/**
	 * 清除路由，产品，方案（目前二手车使用） 新增路由产品
	 * @param prjId
	 * @param OldPreResId
	 * @param preResId
	 * @return
	 * @throws BaseException
	 */
	public boolean changePreInsResInfo(Long prjId,Long OldPreResId,Long preResId)throws BaseException;

}
